repo.or.cz
/
andmenj-acm.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Adding file descriptor in template.
[andmenj-acm.git]
/
850 - Crypt kicker II
/
inputGen.cpp
blob
b815693010766d58302a972a74c2581af198b824
1
#include <string>
2
#include <iostream>
3
4
using namespace
std
;
5
6
string text
=
"the quick brown fox jumps over the lazy dog"
;
7
int
key
;
8
9
void
encrypt
(
string s
){
10
for
(
int
i
=
0
;
i
<
s
.
size
(); ++
i
){
11
if
(
s
[
i
] ==
' '
){
12
cout
<<
" "
;
13
continue
;
14
}
15
char
c
=
'a'
+ ( (
s
[
i
]-
'a'
+
key
)%
26
);
16
cout
<<
c
;
17
}
18
cout
<<
endl
;
19
}
20
21
int
main
(){
22
while
(
cin
>>
key
&&
key
){;
23
string s
;
24
getchar
();
25
getline
(
cin
,
s
);
26
encrypt
(
text
);
27
encrypt
(
s
);
28
}
29
}